#ifndef		_Sick_V2_H_
#define		_Sick_V2_H_

#include	"stdint.h"

#define  	Max_Len				(1000)
#define 	MinSegNum			(30)
//no more than 255
#define		Max_Num				(100)
#define	  Max_DataNum			(812)

typedef struct {
//	uint8_t		result;
	int16_t 	circ_x;//mm
	int16_t 	circ_y;//mm
	int32_t 	circ_r2;//cm
	int32_t		circ_r2_bias;
	int16_t		circ_points;
	int16_t 	mid_x;
	int16_t		mid_y;
}Sick_Info;
typedef struct{
	Sick_Info	Queue[Max_Num];
	uint8_t 	size;
	uint8_t		IsSet;
}Sick_Queue;

typedef struct{
	Sick_Info	Queue[10];
	uint8_t 	size;
	uint8_t		IsSet;
}Sick_Queue_small;



typedef struct {
	int16_t*		Data;
	uint16_t* 	Sn;
}Sick_Data;
typedef struct {
	uint16_t 	Sn_S;
	uint16_t 	Sn_E;
}SegPoint;
typedef struct {
	int16_t* 	X;
	int16_t*	Y;
}XY_Info;
typedef struct {
	Sick_Data	Queue;
	uint16_t	size;
	uint16_t*	DivPoints;
	uint16_t 	Div_Len;
	SegPoint	SegPoints[30];
	uint16_t	Seg_Len;
	uint8_t		IsCheck;
	XY_Info		XY_Queue;
}DataQueue;

#define EthQueue_Max	(5)
typedef struct{
	uint32_t  startangle;
	uint16_t  anglestep;
	int16_t   polardata[Max_DataNum+1];
}EthInfo;
typedef struct{
	uint8_t head;
	uint8_t tail;
	uint8_t size;
	EthInfo queue[EthQueue_Max];
}EthDataQueue;
//typedef struct {
//	int16_t*		Data;
//	uint16_t 	Sn;
//}Sick_Data;

//typedef struct {
//	uint16_t 	Sn_S;
//	uint16_t 	Sn_E;
//}SegPoint;
//typedef struct {
//	int16_t 	X;
//	int16_t		Y;
//}XY_Info;
//typedef struct {
//	Sick_Data	Queue[Max_DataNum];
//	uint16_t	size;
//	uint16_t	DivPoints[Max_DataNum];
//	uint16_t 	Div_Len;
//	SegPoint	SegPoints[30];
//	uint16_t	Seg_Len;
//	uint8_t		IsCheck;
//	XY_Info		XY_Queue[Max_DataNum];
//}DataQueue;

extern int16_t ValidData_D[];
extern Sick_Queue	Sick_Result;
extern DataQueue	Data_Input;
extern EthDataQueue EthQueue;
//extern void Sick_Circle_Mgt(int16_t* Data_In, uint16_t StartAngle);
extern void Sick_Circle_Mgt(void);
extern void Sick_Circle_Init(void);
#endif
